home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 12 / BBS in a box XII-1.iso / Files / Tele / D-F / FSP Control Sample < prev    next >
Encoding:
Text File  |  1987-05-25  |  4.0 KB  |  152 lines  |  [TEXT/MACA]

  1. ;  File Section Maintenance Script
  2. ;   written by Pete Johnson
  3. ;    for the Glassell Park BBS
  4. ;     (213) 258-7649
  5. ;
  6. ;  Define path to prefix filesecs
  7. ;
  8. DEFINE "GP" "Glass:BBS:Files"
  9. ;
  10. ;  The Glassell Park BBS is set up with all files in the following
  11. ;  path -- Glass:BBS:Files: -- followed by a specific file folder.
  12. ;  Each file folder is named for its contents -- Comm, Fonts, Text etc.
  13. ;  If we're in the Comm: folder, we'll see three file directories:
  14. ;  *New, *Comm and *Comm.c
  15. ;  Uploads go to *New. *Comm contains an alphabetically sorted list of
  16. ;  files. *Comm.c contains the same list of files, sorted new -> old.
  17. ;  Each file section is loaded (using alpha-sort version)...
  18. ;  its filepath is reset...
  19. ;  it's sorted by date (in new -> old order)...
  20. ;  and the result is written to the file section with a ".c" suffix...
  21. ;  then it's sorted by filename...
  22. ;  and the result overwrites the original file section.
  23. ;
  24. ;  But first we'll purge deleted file entries from the private
  25. ;  and new sections, if in non-remote mode. In the process, we kill
  26. ;  any files which have been deleted in the *New directory but which
  27. ;  haven't been moved into the corresponding download directory (clean
  28. ;  up for garbage uploads).
  29. ;
  30. ;
  31. DEFINEMACRO "Clean"
  32. CONCATENATE "@3"  "GP:"  "@1"  ; i.e. Glass:BBS:Files:DeskAcc
  33. CONCATENATE "@3"  "@3:*" "@1"  ; i.e. Glass:BBS:Files:DeskAcc:*DeskAcc
  34. CONCATENATE "@1"  "GP:"  "@1"  ; i.e. Glass:BBS:Files:DeskAcc
  35. CONCATENATE "@1"  "@1:"  "@2"  ; i.e. Glass:BBS:Files:DeskAcc:*New
  36. LOAD  "@1"
  37. SUBTRACT "@3"         ;  Eliminate *New entries which have moved
  38. PURGE/DELETE          ;   and kill remaining entries marked deleted.
  39. CHECK/PATH
  40. PURGE
  41. SAVE "@1"
  42. ENDMACRO
  43. ;
  44. Clean "Business" "*New"
  45. Clean "Comm"     "*New"
  46. Clean "DeskAcc"  "*New"
  47. Clean "Fonts"    "*New"
  48. Clean "Games"    "*New"
  49. Clean "Graph"    "*New"
  50. Clean "Music"    "*New"
  51. Clean "Text"     "*New"
  52. Clean "Utility"  "*New"
  53. ;
  54. ;  Special macro for private directories.
  55. ;
  56. DEFINEMACRO "Private"
  57. CONCATENATE "@2" "GP:" "@1"
  58. CONCATENATE "@2" "@2:*" "@1"
  59. LOAD "@2"
  60. PURGE/DELETE
  61. CHECK/PATH
  62. PURGE
  63. SAVE "@2"
  64. ENDMACRO
  65. ;
  66. Private "Private"
  67. Private "Valley"
  68. ;
  69. ;  The *Best directory is a bit different, so it gets its own routine.
  70. ;
  71. CONCATENATE "@1" "GP:" "*Best"
  72. LOAD "@1"
  73. CHECK/PATH
  74. PURGE
  75. SORT/DATE
  76. SAVE "@1.c"
  77. SORT/TITLE
  78. SAVE "@1"
  79. ;
  80. ;  If we're not in remote mode, we also delete files referenced by deleted
  81. ;  FileSection entries, check for valid paths on every entry and purge the
  82. ;  entries marked for deletion. This is not done via remote, because it
  83. ;  takes too much time.
  84. ;
  85. DEFINEMACRO "Shuffle"
  86. CONCATENATE "@2" "GP:" "@1:"     ;  i.e. GP:Comm:
  87. CONCATENATE "@3" "@2*" "@1"      ;  i.e. GP:Comm:*Comm
  88. LOAD "@3"
  89. SETPATH "@2"
  90. SKIP "#3" "Remote"
  91. PURGE/DELETE
  92. CHECK/PATH
  93. PURGE
  94. SORT/DATE
  95. SAVE "@3.c"
  96. SORT/TITLE
  97. SAVE "@3"
  98. ENDMACRO
  99. ;
  100. Shuffle "Business"
  101. Shuffle "Comm"
  102. Shuffle "DeskAcc"
  103. Shuffle "Fonts"
  104. Shuffle "Games"
  105. Shuffle "Graph"
  106. Shuffle "Music"
  107. Shuffle "Text"
  108. Shuffle "Utility"
  109. ;
  110. ;  Now we want to make an aggregate file containing all the sections.
  111. ;  We already have the Utility section sorted alphabetically in memory.
  112. ;
  113. ;  We add all other sections, also sorted alphabetically...
  114. ;
  115. ;  Then get a path list to compare for maintenance.
  116. ;  Then we sort the whole thing alphabetically by filename...
  117. ;  and write the result into a master directory...
  118. ;  and a textfile.
  119. ;
  120. DEFINEMACRO "Collect"
  121. CONCATENATE "@2" "GP:" "@1:*"     ;  i.e. GP:Comm:*
  122. CONCATENATE "@2" "@2"  "@1"       ;  i.e. GP:Comm:*Comm
  123. ADD "@2"
  124. ENDMACRO
  125. ;
  126. Collect "Text"
  127. Collect "Music"
  128. Collect "Graph"
  129. Collect "Games"
  130. Collect "Fonts"
  131. Collect "DeskAcc"
  132. Collect "Comm"
  133. Collect "Business"
  134. ;
  135. SAVETEXT/PATH "GP:*All.path"   ;  for board maintenance
  136. ;
  137. ;  The next line adds listing of All Files to downloads, so callers can
  138. ;  download directory contents. It's a FileSection with one entry
  139. ;  pointing to the *All.txt file we're about to make. I made the entry
  140. ;  with a future date, so it shows at the top of both the chronological
  141. ;  and alphabetical *All file lists.
  142. ;
  143. ADD "GP:*Misc"
  144. SORT/TITLE
  145. SAVE "GP:*All"
  146. SAVETEXT/DESC "GP:*All.txt"
  147. SORT/DATE
  148. SAVE "GP:*All.c"
  149. ;
  150. LAUNCH "Host" "Remote"
  151. END
  152.